package com.zxq.ai.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum ActivityParticipantRecordStatus {

    NOT_REDEEMED(10, "未兑换"),
    REDEEMED(20, "已兑换"),
    ;

    private final Integer code;
    private final String desc;

    public static ActivityParticipantRecordStatus getByCode(Integer code) {
        if (Objects.isNull(code)) {
            return null;
        }

        for (ActivityParticipantRecordStatus status : ActivityParticipantRecordStatus.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}
